﻿using OpenCvSharp;
using System.Collections.Generic;
using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    [Filter("垂直连接器",FilterType.Algorithm)]
    public class AlgorithmVCntracts : FilterBase
    {
        /// <summary>
        /// 待连接的图像列表
        /// </summary>
        [InputParameter("待连接的图像列表")]
        public List<Mat> ConcatMats { get; set; } = new List<Mat>();
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            var ConcatResult = new Mat();
            List<Mat> mats = new List<Mat>();
            mats.AddRange(ConcatMats);
            Cv2.VConcat(mats, ConcatResult);
            return ResultData<Mat>.Accept(TextResource.concat_success, ConcatResult);
        }
    }
}
